from dateutil.parser import parse
from app.data_provider import delete_meeting_and_notifications
from app.dates import is_actual_date
from app.db import fetchall

meetings = fetchall("meetings", ["id", "meeting_datetime"])
if type(meetings) == dict: meetings = [meetings]
for m in meetings:
    if not is_actual_date(parse(m["meeting_datetime"])):
        delete_meeting_and_notifications(m["id"], 555)
